package NGUYENTHECUONG.JAVA_FOR_BASE;

import java.util.Scanner;

public class BT06 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		System.out.println("Moi nhap vao so :");
		String a = sc.nextLine();

		if (a.isEmpty()) {
			System.out.println(" Bat buoc phai nhap vao so !");
		} else {
			int so = Integer.parseInt(a);
			System.out.println("Moi chon kieu : 0- Chan; 1- Le");
			String b = sc.nextLine();

			if (b.isEmpty()) {
				System.out.println("Bat buoc phai nhap kieu chan hay le !");
			} else {
				byte kieu = Byte.parseByte(b);

				int i = 0;
				String tg="";
				//hien thi so 
				 /*	while (i < so) {
					if (kieu == 0) {
						if (i % 2 == 0) {
							System.out.println("Gia tri chan la: " + i);
							
						}
					} else {
						if (i % 2 != 0) {
							System.out.println("Gia tri le la :" + i);
						}
					}*/
				// hien thi tat ca
				do{
					if(kieu==0){
						if(i%2==0){
							tg+="-"+i;
						}
					}
					else{
						if(i%2!=0){
							tg+="-"+i;
						}
					}
					i++;
				}
				while(i<so);
				
					System.out.println("ket qua:"+tg);
				}

			}

		}
	}


